package mobile;

public class MobileType {

	private int id;
	private String name;

	public MobileType(int idValue, String nameValue) {
		setId(idValue);
		setName(nameValue);
	}

	public MobileType() {
		this(-1, "unknown");
	}

	public void setId(int idValue) {
		if (idValue > 0) {
			this.id = idValue;
		} else {
			this.id = -1;
		}
	}

	public int getId() {
		return this.id;
	}

	public void setName(String nameValue) {
		if (nameValue != null && nameValue.trim().length() > 0) {
			this.name = nameValue;
		} else {
			this.name = "unknown";
		}
	}

	public String getName() {
		return this.name;
	}

	public String toString() {
		String result = String.format("%d - %s", id, name);
		return result;
	}
}
